
<? 
if (!isset($_POST) || empty($_POST)) {
?>
<h2>Please Provide feedback:</h2>
<form method="post" action="http://loki.local/~plummer/uny-con/index.php?uny=contact_form.php">
	<div class="row">
		<span class="label">Name:</span><span class="formw"><input type="text" size="30" maxlength="45" name="name" /></span>
	</div>
	<div class="row">
		<span class="label">E-mail address:</span><span class="formw"><input type="text" size="30" maxlength="45" name="email_addr" /></span>
	</div>
	<div class="row">
		<span class="label">What area are you contacting us about:</span><span class="formw"><select name="subject">
    	<option>Event Related</option>
    	<option>Exhibitors</option>
    	<option>Registration</option>
    	<option>Special Guests</option>
    	<option>Volunteer</option>
    	<option>Web Site Feedback</option>
    	<option>Other</option>
    </select></span>
    </div>
	<div class="row">
		<span class="label">Text of Message:</span><span class="formw"><textarea name="input" rows="10" cols="30">
</textarea></span>
	</div>
	<div class="row">
	<span class="label"><input type="submit" name="Submit" value="Submit" /></span>
	<span class="formw"><input type="reset" name="Reset" value="Reset Form" /></span>
	</div>
</form>

<?
}

if (isset($_POST) && !empty($_POST)) {

?>

<h2>Thank you!</h2>

<?

$processed_input = stripslashes($_POST['input']);

// The email portion of todays form

$subject = $_POST['subject'];
$headers = "From: " . $_POST['name'] . " <" . $_POST['email_addr'] . ">" ;
$message = $processed_input."\n".$_POST['name'] ;

$email="plummer@cs.geneseo.edu,denk@geneseo.edu,tigger00@rochester.rr.com";
// send email.
mail($email, $subject, $message, $headers);
// thus concludes the email portion of todays form

$processed_input = str_replace("\n" , "<br />", $processed_input);
?>
<p>This is what was sent:<br /><br />
Name: <? print $_POST['name'] ?><br />
E-mail: <? print $_POST['email_addr'] ?><br />
Subject: <? print $_POST['subject'] ?><br />
Input: <? print $processed_input ?><br />
</p>
<?
}
?>